/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package com.frogs.manager;

import com.frogs.data.AbstractManager;
import com.frogs.exception.FrogsFindException;
import com.frogs.exception.FrogsMergeException;
import com.frogs.exception.FrogsPersistException;
import com.frogs.exception.FrogsRemoveException;
import com.frogs.model.Empresa;
import java.util.List;
import javax.persistence.EntityManager;

/**
 *
 * @author gabrielbran
 */
public class ManagerEmpresa extends AbstractManager {

    public ManagerEmpresa() {
        super();
    }

    public Empresa guardaEmpresa(Empresa e) throws FrogsPersistException {
        return (Empresa) super.persistObject(e);
    }

    public Empresa actualizaEmpresa(Empresa e) throws FrogsMergeException {
        return (Empresa) super.mergeObject(e);
    }

    public void eliminaEmpresa(Empresa e) throws FrogsRemoveException  {
        super.removeObject(e);
    }

    public List<Empresa> getListaEmpresas() throws FrogsFindException {
        return (List<Empresa>) super.getEntityList();
    }

    public Empresa buscarEmpresa(String s) throws Exception {
        return (Empresa) super.findById(s);
    }

    @Override
    public EntityManager getEm() {
        return super.getEm();
    }

    @Override
    public String getEntityName() {
        return "Empresa";
    }
}
